package com.xzx.mybatis.mapper;

import com.xzx.mybatis.po.EmployeePO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author xinzhixuan
 * @version 1.0
 * @date 2025/6/21 12:44
 */
public interface EmployeeMapper {

    int insert(EmployeePO employee);
    int insert2(EmployeePO employee);

    EmployeePO getByIdAndName(@Param("id") Long id, String name);

    List<EmployeePO> getList();
    Map<String, Object> getMap(@Param("id") Long id);
    // Object类型使用Map封装
    @MapKey("last_name")
    Map<String, Object> getMap3();

    @MapKey("lastName")
    Map<String, EmployeePO> getMap2();


    EmployeePO getByResultMap(@Param("id") Long id);

    EmployeePO getDeptById(@Param("id") Long id);
    EmployeePO getDeptById2(@Param("id") Long id);

    List<EmployeePO> getByDeptId(@Param("deptId") Long deptId);


    List<EmployeePO> getByDiscriminator();

}
